#ifndef BEAVERTHREAD_H
#define BEAVERTHREAD_H

#include <QThread>
#include <QAbstractSocket>
#include <QStringList>
#include <QSslError>

class BeaverThread : public QThread
{
    Q_OBJECT
private:
	class BeaverThreadPrivate;
	BeaverThreadPrivate *d;
public:
    explicit BeaverThread(QObject *parent = 0);
	~BeaverThread();


	bool isEncrypted() const;
	bool isConnected() const;


private slots:
	void slot_error(QAbstractSocket::SocketError error);
	void slot_sslErrors(const QList<QSslError> &errors);


signals:
	void disconnected();
	void connected();
	void encrypted();
	void hostNotFound();
	void connectionRefused();
	void sslError(QStringList);

public slots:
	void stop();
	void connectToHostEncrypted(const QString &hostName, quint16 port);
	void disconnectFromHost();
	void send(const QByteArray &data);
};

#endif // BEAVERTHREAD_H
